﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="userauthority.aspx.cs"
    Inherits="Com.Rivyer.Web.admin.userauthority" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户权限</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/rivcontent.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <%if (DesignMode)
      { %>
    <script type="text/javascript" src="../js/ASPxScriptIntelliSense.js"></script>
    <%} %>
    <script type="text/javascript">
        
    </script>
    <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="24" bgcolor="#353c44">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="6%" height="19" valign="bottom">
                                                        <div align="center">
                                                            <img src="../images/tb.gif" width="14" height="14" /></div>
                                                    </td>
                                                    <td width="94%" valign="bottom">
                                                        <span class="STYLE1">用户权限</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="font-size: 12px; width=100%">
                    <div id="rivcontent">
                        <div class="title">
                            用户权限
                        </div>
                        <dx:ASPxGridView ID="userauthoritygrid" runat="server" Width="600px" AutoGenerateColumns="False"
                            DataSourceID="SqlDataSource1" KeyFieldName="username" Font-Size="12px">
                            <Columns>
                                <dx:GridViewCommandColumn VisibleIndex="0">
                                    <EditButton Visible="True">
                                    </EditButton>
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn FieldName="username" ReadOnly="True" 
                                    VisibleIndex="1">
                                    <PropertiesTextEdit EnableFocusedStyle="False">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataCheckColumn FieldName="isaprove" VisibleIndex="2">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="ipmanager" VisibleIndex="3">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="monitormanager" VisibleIndex="4">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="materailmanager" VisibleIndex="5">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="isminister" VisibleIndex="6">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="issection" VisibleIndex="7">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="isadmin" VisibleIndex="8">
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataCheckColumn FieldName="isdutymanager" VisibleIndex="9">
                                </dx:GridViewDataCheckColumn>
                            </Columns>
                            <SettingsPager PageSize="15">
                            </SettingsPager>
                            <Styles>
                                <Header HorizontalAlign="Center">
                                </Header>
                                <Cell HorizontalAlign="Center">
                                </Cell>
                            </Styles>
                        </dx:ASPxGridView>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ITConnectionString %>"
        
        DeleteCommand="DELETE FROM [tb_userauthority] WHERE [username] = @username" InsertCommand="INSERT INTO [tb_userauthority] ([username], [isaprove], [ipmanager], [monitormanager], [materailmanager], [isminister], [issection], [isadmin], [isdutymanager]) VALUES (@username, @isaprove, @ipmanager, @monitormanager, @materailmanager, @isminister, @issection, @isadmin, @isdutymanager)"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [tb_userauthority] WHERE ([username] NOT LIKE '%' + @username + '%')"
        
        UpdateCommand="UPDATE [tb_userauthority] SET [isaprove] = @isaprove, [ipmanager] = @ipmanager, [monitormanager] = @monitormanager, [materailmanager] = @materailmanager, [isminister] = @isminister, [issection] = @issection, [isadmin] = @isadmin, [isdutymanager] = @isdutymanager WHERE [username] = @username">
        <DeleteParameters>
            <asp:Parameter Name="username" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="username" Type="String" />
            <asp:Parameter Name="isaprove" Type="Int32" />
            <asp:Parameter Name="ipmanager" Type="Int32" />
            <asp:Parameter Name="monitormanager" Type="Int32" />
            <asp:Parameter Name="materailmanager" Type="Int32" />
            <asp:Parameter Name="isminister" Type="Int32" />
            <asp:Parameter Name="issection" Type="Int32" />
            <asp:Parameter Name="isadmin" Type="Int32" />
            <asp:Parameter Name="isdutymanager" Type="Int32" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="rivyer" Name="username" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="isaprove" Type="Int32" />
            <asp:Parameter Name="ipmanager" Type="Int32" />
            <asp:Parameter Name="monitormanager" Type="Int32" />
            <asp:Parameter Name="materailmanager" Type="Int32" />
            <asp:Parameter Name="isminister" Type="Int32" />
            <asp:Parameter Name="issection" Type="Int32" />
            <asp:Parameter Name="isadmin" Type="Int32" />
            <asp:Parameter Name="isdutymanager" Type="Int32" />
            <asp:Parameter Name="username" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
